<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="Public/Admin/css/style.css" type="text/css" rel="stylesheet" />
<link href="Public/Admin/css/skin/fonts/font-awesome.min.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="Public/Admin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="Public/Admin/js/effect.js"></script>
<script type="text/javascript" src="Public/Admin/js/common.js"></script>
</head>

<body class="mainbody">
<!--导航栏-->
<div class="location">
	<a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
	<!--加target="_blank"，防止在右侧的mainframe显示-->
    <a href="<?php echo U('Index/index')?>" class="home" target="_blank"><i></i><span>首页</span></a>
    <i class="arrow"></i>
    <span>货品列表</span>
</div>
<!--/导航栏-->

<!--工具栏-->
<form action="<?php echo U('GoodsList/add')?>" method="post">
<div id="floatHead" class="toolbar-wrap" style="height:52px;">
	<div class="toolbar" style="width:1693px;">
    	<div class="box-wrap">
        	<!--左-->
            <div class="l-list">
            	<ul class="icon-list">
                	<!--<li><a class="add" href="javascript:;"><i></i><span>新增</span></a></li> -->   
                	<input type="submit" name="btnSubmit" value="提交保存" id="btnSubmit" style="width:60px;height:25px;background:#FAFAFA;border:1px solid #EEE;outline:none;color:#666;cursor:pointer;">            
                </ul>                
            </div>
        </div>
    </div>
</div>
<!--/工具栏-->

<!--列表-->
<div class="table-container">	
	<!--货品列表-->	
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ltable">
    	<tbody>
        	<tr class="odd_bg">
              <th width="6%">货品ID</th>
              <th align="left" width="26%">颜色</th>
              <th align="left" width="6%">尺码</th>
              <th align="left" width="6%">库存</th>
              <th align="left" width="6%">货号</th>
              <th align="left" width="6%">默认选中</th>
              <th width="6%">操作</th>            
            </tr>
            
            <?php foreach ($data as $k=>$v){?>
            <tr>
              <td align="center"><?php echo $v['glid']?></td>
              <?php         	
				foreach($GAttrData as $KK=>$vv){
					if($v['combine'][0] == $vv['gaid']){				
                ?>
              		<td><?php echo $vv['gavalue'] ?></td>
                <?php }
              		if($v['combine'][1] == $vv['gaid']){
              	?>          	
              		<td><?php echo $vv['gavalue'] ?></td>
                <?php }}?>
              <td><?php echo $v['inventory']?></td>
              <td><?php echo $v['number']?></td>
              <?php if( $v['is_default'] == 1 ){?>
                
              		<td>是</td>
              <?php }else{?>
              		<td>否</td>
              
               <?php }?>
              <td align="center">
                <a href="<?php echo U('GoodsList/edit',array('glid'=>$v['glid']))?>">编辑</a>
                <a href="javascript:if(confirm('确认删除吗？')) location.href='<?php echo U('GoodsList/del',array('glid'=>$v['glid']))?>';">删除</a>
              </td>
            </tr>
            <?php }?>
            
            <tr>
              <td align="center">添加货品</td>
              <td>
              	<select name="color"  style="border:1px solid #eee;" >
					<option value="">请选择</option>
						<?php foreach ($color as $v){?>
							<option value="<?php echo $v['gaid']?>"><?php echo $v['gavalue']?></option>
						<?php }?>
				</select>
              </td>
              
              <td>
              	<select name="size"  style="border:1px solid #eee;" >
					<option value="">请选择</option>
						<?php foreach ($size as $v){?>
							<option value="<?php echo $v['gaid']?>"><?php echo $v['gavalue']?></option>
						<?php }?>
				</select>
              </td>
              <td>
              	<input class="input normal" type="text" placeholder="" required="" name="inventory">
              </td>
              <td>
              	<input class="input normal" type="text" placeholder="" required="" name="number">
              </td>
              <input type="hidden" name="goods_gid" value="<?php echo Q('get.goods_gid',0,'intval')?>"  />
              <td align="center">
              	<!--推荐-->
				<!--radio 单选-->
				<div class="form-group">
					<label for="">默认选中</label><br  />
					<label class="radio-inline">
					  <input type="radio" name="is_default" id="inlineRadio1" value="1"> 是
					</label>
					<label class="radio-inline">
					  <input type="radio" name="is_default" id="inlineRadio1" value="0" checked> 否
					</label>
				</div>
				<!--推荐_ok-->
              </td>
            </tr>
            
        </tbody>
    </table>
    <!--/文字列表-->
</div>
<!--/列表-->
</form>
<!--内容底部-->
<!--高20的空间-->
<div class="line20"></div>
<!--分页-->
<div class="pagination">
	<ul>
  		<?php echo $page?>
	</ul>
</div>
<!--/内容底部-->
</body>
</html>
